<template>
  <el-pagination
      @size-change="handleSizeChange"
      @current-change="handleCurrentChange"
      @prev-click="handleCurrentChange"
      @next-click="handleCurrentChange"
      :current-page="pageOptions.currentPage"
      :page-sizes="pageOptions.pagesizes"
      background
      :page-size="pageOptions.pageSize"
      layout="total, sizes, prev, pager, next"
      :total="pageOptions.total">
  </el-pagination>
</template>

<script>
  export default {
    name: 'PageComp',
    props: {
      pageOptions: {
        type: Object
      }
    },
    methods: {
      handleSizeChange(pageSize) {
        this.pageOptions.sizeChangeCallback(pageSize)
      },
      handleCurrentChange(currPage) {
        this.pageOptions.currentChangeCallback(currPage)
      }
    }
  }
</script>

<style scoped>
.el-pagination {
  position: absolute;
  bottom: 4px;
  right: 0;
}
</style>